import java.util.ArrayList;

/**
 * 
 * This class represents an Order of cookies. It consists of zero or multiple cookie positions.<br><br>
 * 
 * Invariants: Can only contain valid cookie positions.
 */
@Author("Lajos-Zoltan Zsombori, David Schibl")
public class Order {

	private ArrayList<Position> orders = null;
	
	/**
	 * Creates a new Order.
	 */
	public Order(){
		orders = new ArrayList<Position>();
	}
	
	/**
	 * Adds an order with the provided parameters.
	 * 
	 * @param d
	 * 		Dough that should be used
	 * @param s
	 * 		Shape that should be used for the cookies.
	 * @param f
	 * 		Filling that should be used for the cookies (INDICATES DOUBLECOOKIE!)
	 * @param count
	 * 		Amount of cookies that is to be baked.
	 */
	public void add (Dough d, Shape s, Fill f, int count){
		// d != null; s != null; count > 0
		orders.add (new Position(d,s,f,count));
		// valid position added to the order
	}
	
	/**
	 * Prints all positions to stdout.
	 */
	public void drucke () {
		for(Position p: orders){
			System.out.print(p.toString()+"\n");
		}
	}
	
	/**
	 * @return
	 * 		Returns the current order in an ArrayList<Position> object.
	 */
	public ArrayList<Position> getOrder(){
		return orders;
	}

}
